<%@ page contentType="text/html; charset=utf-8" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>数据 - AdminLTE2定制版 | Log in</title>
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <link rel="stylesheet" href="../plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../plugins/ionicons/css/ionicons.min.css">
    <link rel="stylesheet" href="../plugins/adminLTE/css/AdminLTE.css">
    <link rel="stylesheet" href="../plugins/iCheck/square/blue.css">

</head>

<script>
    window.onload = function () {
        if (window.parent.window != window) {
            window.top.location = "/login.jsp";
        }
    }
</script>

<body class="hold-transition login-page">
<div class="login-box">
    <div class="login-logo">
        <a href="all-admin-index.html">修改密码</a>
    </div>
    <!-- /.login-logo -->
    <div class="login-box-body">
        <p class="login-box-msg">修改密码</p>
        <form action="#" method="post">
            <%--<div class="form-group has-feedback" id="id1">
                <input type="email" name="email" value="lw@export.com" class="form-control" placeholder="Email">
                <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
            </div>--%>
            <div class="form-group has-feedback">
                <input type="password" name="password" id="id1" class="form-control" placeholder="原密码">
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            </div>
            <div class="form-group has-feedback">
                <input type="password" name="password" id="id2" class="form-control" placeholder="新密码">
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            </div>
            <div class="form-group has-feedback">
                <input type="password" name="password" id="id3" class="form-control" placeholder="再次输入新密码">
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            </div>
            <div class="row">
                <div class="col-xs-8">
                    <div class="checkbox icheck">
                        <label class="">${error}</label>
                    </div>
                </div>
                <div class="col-xs-4">
                    <button type="button" id="btnEp" class="btn btn-primary btn-block btn-flat">确定</button>
                </div>
            </div>
        </form>
        <%--<div class="social-auth-links text-center">
            <p>- 或者 -</p>
            <a href="#" class="btn btn-block btn-social btn-facebook btn-flat"><i class="fa fa-qq"></i> 腾讯QQ用户登录</a>
            <a href="#" class="btn btn-block btn-social btn-google btn-flat"><i class="fa fa-weixin"></i> 微信用户登录</a>
        </div>
        <div id="login_container"></div>--%>
    </div>
</div>
<script src="../plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="../plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="../plugins/iCheck/icheck.min.js"></script>
<script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
<%--<script>
    var obj = new WxLogin({
        self_redirect:false,
        id:"login_container",
        appid: "wx3bdb1192c22883f3",
        scope: "snsapi_login",
        redirect_uri: "http://note.java.itcast.cn/weixinlogin"
    });
</script>--%>

<script>
    $(function () {
        $('input').iCheck({
            checkboxClass: 'icheckbox_square-blue',
            radioClass: 'iradio_square-blue',
            increaseArea: '20%' // optional
        });
    });
</script>
<script>
    $(function () {
        $('#id1').blur(function () {
            var value = $("#id1").val();
            var url = "/system/user/findPW.do";
            var data = {"password": value};
            $.post(url, data, function (d) {
                if (d == "0") {
                    //为确定按钮绑定事件
                    alert("原密码不正确")
                    $("#btnEp").prop("disabled",true)
                }
            })
        });

        $("#btnEp").click(function () {
           /* 两次输入是否一致*/
            var v1 = $("#id2").val();
            var v2 = $("#id3").val();
            if (v1 == v2) {
               /* //两次输入一致，发送ajax请求*/
                location.href = "${ctx}/system/user/updatePW.do?newpassword=" + v1;
            } else {
                /*//两次输入不一致，弹出错误提示*/
                alert("两次输入密码不一致")
            }
        })
    });
</script>

</body>
</html>
